package com.hwl.eduservice.controller;

import com.hwl.commonutils.result.RespBean;
import com.hwl.eduservice.service.TeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "讲师")
@RestController
@RequestMapping("/api/eduTeacher")
public class ApiTeacherController {

    @Resource
    private TeacherService teacherService;

    @ApiOperation("获取所有讲师")
    @GetMapping("list")
    public RespBean getAllTeacher() {
        return RespBean.ok().data(teacherService.list(null));
    }

    @ApiOperation("根据id查看讲师信息")
    @GetMapping("get/{id}")
    public RespBean getById(@PathVariable String id) {
        return RespBean.ok().data(teacherService.selectTeacherInfo(id));
    }
}
